<?php
	require("includes/basic.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
	<HEAD>
		<TITLE> :: <?php echo $appName?> :: </TITLE>
		<link rel='stylesheet' type='text/css' href='style/admin.css'>
		<script type='text/javascript' src='js/general.js'></script>
		<script type='text/javascript' src='js/help.js'></script>
		<script type='text/javascript' src='js/list.js'></script>
		<script type='text/javascript' src='js/jquery-latest.js'></script>
		
		<script type="text/javascript">
		$(document).ready(function()
		{
			$('#listSelectAll').click(function()
				{
					$('#viewprojects').find(':checkbox').attr('checked', this.checked);

				});
			$("#project").change(function()
			{
				var pid=$('#project').val();
				var dataString = 'pid='+ pid;
				if(pid == 0)
				{
					alert("Select Project");
				}
				else
				{
					alert(pid);
					$.ajax
					({
						type: "POST",
						url: "vrtodo.php",
						data: dataString,
						cache: false,
						success: function(html)
						{
							
						$("#mytask").html(html);
						} 
					});
				}
			});
			

			$("#Close").click(function()
			{
				var id=$(':checkbox:checked').val();
				var data = new Array();
				$("input[name='chkName']:checked").each(function(i) {
						data.push($(this).val());
				});
				var dataString = 'data=' + data;
				//alert(data);
				$.ajax
				({
					type: "POST",
					url: "mytask.php",
					data: dataString,
					cache: false,
					success: function(html)
					{						
					$("#mytask").html(html);
					} 
				});
			});

		});


		</script>
		<script type='text/javascript'>
			function bodyLoad() {
				setContext("This is the main administration view.");
				setActiveItemByName("/");
				loadingOff();
				try {
					document.getElementById('loaderContainerH').height = wHeight();
				} catch (e) {}
			}
			function bodyUnload() {
				loadingOn();
			}
		</script>
	</HEAD>

	<body onLoad='bodyLoad();' onUnload='bodyUnload();'>
		<?php $pageName="To Do List"; ?>
		<?php require("includes/header.php"); ?>

		<!-- devi : body content begins here -->

	<table border='0' cellspacing='0' cellpadding='0' id='loaderContainer' onClick='return false;'>
		<tr><td id='loaderContainerH'><div id='loader'>
			<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>
				<p><img src='images/wait.gif' height='32' width='32' alt=''/>
				<strong>Please wait.<br>Loading ...</strong></p>
			</td></tr></table>
		</div></td></tr>
	</table>
	<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td id='screenH'>
		<div class='pathbar'><a href='index.php'>Admin</a> -> To Do List</div>
		<div class='screenTitle'>
			<table width='100%' cellspacing='0'>
				<tr>
					<td>
						<?php echo $pageName;?>
					</td>		
				</tr>
			</table>
		</div>
<table class="dialog" cellpadding="0" cellspacing="0"><tr><td>
<table class="dialogbox" cellpadding="0" cellspacing="0">
<tr><td>

<!-- icons block area start -->

<!-- icons block area end -->
<div class="dialoghead" unselectable="on"></div><div class="dialogcontent" unselectable="on">
<!-- dialogcontent start -->

<div class='help' id='helpae' onMouseOut="hMH('ae');">Click here to edit the selected group.</div>
<div class='hide' id='confae'>null</div>
<div class='help' id='helpau' onMouseOut="hMH('au');">Click here to add or remove users to this group.</div>
<div class='hide' id='confau'>null</div>
<div class='help' id='helpaa' onMouseOut="hMH('aa');">Click here to activate the selected group.</div>
<div class='hide' id='confaa'>Are you sure you want to activate the selected group?</div>
<div class='help' id='helpac' onMouseOut="hMH('ac');">Click here to deactivate the selected group.</div>
<div class='hide' id='confac'>Are you sure you want to deactivate the selected group?</div>
<div class='help' id='helpad' onMouseOut="hMH('ad');">Click here to delete the selected group.</div>
<div class='hide' id='confad'>null</div>
<div class='help' id='helpde' onMouseOut="hMH('de');">Click here to edit the selected group.</div>
<div class='hide' id='confde'>null</div>
<div class='listArea'>
<div><center><br/>

Select Project <select name="project" id="project" onchange='showtaskres(this.value)'>
	<option value="0" selected>--Select--</option>
	<?php
	
	$projects=mysql_query("SELECT * FROM project_master where project_created_by=(select user_created_by from user_master where vendor_id=$userId)");
	if(mysql_num_rows($projects)>0)
					{
					while($projectr=mysql_fetch_array($projects))
						{
							echo "<option value=".$projectr['project_id'].">".$projectr['project_name']."</option>";
						}
					}

	?>
	</select>
	</center>
	<br/><br/>
	</div>
<!-- 3D block start -->
<fieldset class="dialogblock">
<legend><span class="textbold" unselectable="on">Tasks</span></legend>
<?php 
$projects=mysql_query("select * from project_master where project_created_by=(select vendor_created_by from vendor_master where vendor_id=$userId)");
$noOfProjects=mysql_num_rows($projects);
$sr=1;
$class="evenrowbg";
?>
		<table width='100%' cellspacing='0' cellpadding='0' border='0'>
			<tr><td>
			<table width='100%' cellspacing='0'>	
				<tr>
					<td align='left'>
						<!-- Total Task Count <?php echo $noOfProjects;?> -->
					</td>
					<td class='misc'>&nbsp;
						
					</td>
				</tr>
			</table>
			<table width='100%' cellspacing='0' style='margin-bottom: 5px'>
		<tr>
			<td class='main'>
				<div>
					<input type='text' name='listSearchFilter' id='listSearchFilter' value='' size='20' maxlength='245' style='vertical-align: bottom;' >
					<span class="link" onClick=""><img src='images/search.png' alt='Search' title='Search'>&nbsp;<a href='#' style='white-space: nowrap;'>Search</a></span>
					<div class='help' id='helpsearch'>Filters the list by Name.</div>
					&nbsp;&nbsp;	
				</div>
			</td>
			<td class='misc'>
			
			
			<span class="link" ><img src='images/multi_activate.png' alt='Close Task' title='Close Task'>&nbsp;<a id='Close' style='white-space: nowrap;'>Close</a></span>
&nbsp;&nbsp;
			
		</td>
	</tr>
</table>
			<table width='100%'><tr><td id='mytask'><?php require("vrtodo.php"); ?>
			</td></tr></table></td></tr>
		</table>
			
</fieldset>

<!-- 3D block end -->
</div>


<!-- dialogcontent end -->
</div>

</td></tr></table>
</td></tr></table>
<p>&nbsp;</p>
	</td></tr></table>

		<!-- devi : body content ends here -->
		<?php
		if($noOfTasks < 8)
		{ ?>
			<style>
			.footer{
			position:absolute; bottom:0px;
		}
			</style>
		<?php
				}
		?>
		<?php require("includes/footer.php"); ?>
	</BODY>
</HTML>
